<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/mock-min.js"></script>
    <script src="../js/mock.js"></script>
</head>
<body>
    账号<input type="text"  id="acount">
    密码<input type="password" id="password">
    <button onclick="login()">登录</button>
    <button onclick="register()">注册</button>
    <script>

        function login(){
            var acount=document.getElementById('acount').value
            var psw=document.getElementById('password').value
            let user={
                username:acount,
                password:psw
            } 
            if(acount==''||psw==''){
                return alert('请输入')
            }
            $.ajax({
                type:'post',
                url:'/js/userlogin',
                data:JSON.stringify(user),
                success:function(data){
                }
            })
        }
      
        const register=()=>{
            window.location.href='./register.html'
        }
    </script>
</body>
</html>